package com.hellomeng.annotation;

import com.hellomeng.bean.CollectionBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestAnnotation {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        //默认情况下：注解方式添加的Bean，名字就是Bean的类名首字母小写
        BeanController bean1 = (BeanController) applicationContext.getBean("beanController");
        //在注解时指定了bean的名字
        BeanService bean2 = (BeanService) applicationContext.getBean("beanServicexxxx");
        System.out.println(bean1);
        System.out.println(bean2);
    }
}
//我是BeanController
//我是BeanService